package com.qf.controller;

import com.qf.entity.po.User;
import io.swagger.annotations.Api;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping(value = "test")
@Api(tags = {"测试模块"})
public class testController {
    //master布洛妮娅
    //mobile布洛妮娅

    @GetMapping("a")
    public String aPage(){
        return "demo/a";
    }

    @GetMapping("b")
    public String bPage(){
        return "demo/b";
    }

    @GetMapping("testInfo")
    public String testInfo(HttpServletRequest request){
        request.setAttribute("name","布洛妮娅");
        User user = new User();
        user.setName("希尔");
        user.setAge(18);
        user.setSex(0);
        request.setAttribute("user",user);

        request.setAttribute("msg1","<h2>普通字符串</h2>");

        //视图解析器 业务逻辑  classpath:/templates/   suffix: .html
        return "index";
    }

}
